package com.ftg.product.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author kangjx
 * @createTime 2022/8/18
 */
@Configuration
public class MybatisPlusConfig {

    /**
     * 相当于在mybatisplus当中声明了一个拦截器
     * 拦截器 创建了一个分页
     * @return
     */
    @Bean
    public MybatisPlusInterceptor abc(){
        MybatisPlusInterceptor m = new MybatisPlusInterceptor();
        m.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return m;
    }

}
